package file

import (
	"context"
	"git.mycaigou.com/gfyx/micro-gfyx-user-service/infrastructure/repository/file"
)

type FileService struct {
	commonFileRepo file.CommonFileRepoIface
}

func NewFileService(commonFileDataRepo file.CommonFileRepoIface) FileServiceIface {
	return &FileService{
		commonFileRepo: commonFileDataRepo,
	}
}

func (f *FileService) SaveToFile(ctx context.Context, ossFilePath, fileType, fileName, business string, size int64, isPrivate int64, tenantCode string) (string, error) {
	return f.commonFileRepo.SaveToFile(ctx, ossFilePath, fileType, fileName, business, size, isPrivate, tenantCode)
}

func (f *FileService) QueryByUid(ctx context.Context, fileUid string) (*file.CommonFilePo, error) {
	return f.commonFileRepo.QueryByUid(ctx, fileUid)
}
